<?php 
   $mtime = microtime(); 
   $mtime = explode(" ",$mtime); 
   $mtime = $mtime[1] + $mtime[0]; 
   $starttime = $mtime; 
;?> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2" />
<title>Untitled Document</title>
</head>

<body>
<?php
if ( !empty($_POST['partid']) && $_POST['submit'] == "OK" ) {
	require_once("./includes/class.Part.inc.php");
	try {
		$part = new Part();
		$part->UpdateInSQL($_POST['partid'], $_POST['price'], $_POST['correctionmultiplier']);
	} catch ( Exception $a) {
		echo "Hiba!";
	}	
}

if (  ( !empty($_FILES['idlist']['tmp_name']) || isset($_POST['id'])) && $_POST['submit'] == "OK") {
	
	if ( !empty($_FILES['idlist']['tmp_name']) ) {
		$uploaddir = 'C:\\AppServ\\www\\miksofttech\\workdir\\demo\\';
		$uploadedfile = $uploaddir . basename($_FILES['idlist']['name']);
		move_uploaded_file($_FILES['idlist']['tmp_name'], $uploadedfile);
	} else {
		$uploadedfile = $_POST['id'];
	}
	
	require_once("./includes/class.CalcFromFile.inc.php");
		
	$calc = new CalcFromFile($uploadedfile);
	
	$calc->Draw();
	
} else {
	include("./html/formkalklist.html");
}
?>
<?php 
   $mtime = microtime(); 
   $mtime = explode(" ",$mtime); 
   $mtime = $mtime[1] + $mtime[0]; 
   $endtime = $mtime; 
   $totaltime = ($endtime - $starttime); 
   echo "<hr>This page was created in ".$totaltime." seconds"; 
;?>
</body>
</html>